import bus from '@/bus'
let data = {
  status: 'pass',
  totalItem: 1,
  pageSize: window.$pageSize / 2,
  currentPage: 1,
  columns: [{
    title: '模板名称',
    key: 'freightName',
    minWidth: 200,
    tooltip: true
  }, {
    title: '默认首件(件/kg)',
    key: 'defaultNum',
    align: 'left',
    minWidth: 150
  }, {
    title: '默认首费(元)',
    key: 'defaultFee',
    align: 'left',
    minWidth: 150
  }, {
    title: '默认续件(件/kg)',
    key: 'extraNum',
    align: 'left',
    minWidth: 150
  }, {
    title: '默认续费(元)',
    key: 'extraFee',
    align: 'left',
    minWidth: 150
  }, {
    title: '最后编辑时间',
    key: 'modifyDate',
    align: 'left',
    minWidth: 170
  }, {
    title: '是否系统内置',
    key: 'isSystemed',
    minWidth: 130,
    align: 'left',
    render: (h, p) => {
      return h('div', p.row.isSystemed ? '是' : '否')
    }
  }, {
    title: '启用',
    key: 'isEnabled',
    minWidth: 100,
    render: (h, p) => {
      return h('div', p.row.isEnabled ? '是' : '否')
    }
  }, {
    title: '操作',
    width: 200,
    align: 'right',
    fixed: 'right',
    render: (h, params) => {
      let editBtn = h('Button', {
        class: 'mr',
        props: {
          size: 'small',
          type:'primary',
          disabled: !params.row.isSystemed && params.row.isContainBuyer
        },
        on: {
          click: () => {
            bus.$emit('onEdit', {row: params.row})
          }
        }
      }, '修改')
      let openBtn = h('Button', {
        class: 'mr',
        props: {
          size: 'small',
          type:'warning',
          disabled: params.row.isSystemed || params.row.isContainBuyer
        },
        on: {
          click: () => {
            bus.$emit('onOpen', {row: params.row})
          }
        }
      }, params.row.isEnabled ? '禁用' : '启用')
      let bindBtn = h('Button', {
        class: 'mr',
        props: {
          size: 'small',
          disabled: params.row.isSystemed || params.row.isContainBuyer
        },
        on: {
          click: () => {
            bus.$emit('onBind', {row: params.row})
          }
        }
      }, '绑定')
      return h('div', [editBtn, openBtn, bindBtn])
    }
  }],
  data: []
}
export default data
